﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>内容与属性中使用javascript表达式的方法</title>
    <link href="../css/bootstrap.css"/>
    <link href="../css/bootstrap-theme.css"/>
    <style>
        .hd1{
            color: red;
        }
        .hd2{
            color: blue;
        }
    </style>
</head>
<body>
    <h1>内容与属性中使用javascript表达式的方法</h1><br/>

    <div id="app">
        <h1 v-once>{{n}}</h1>
        <h2>{{n+2}}</h2>
        <h2>{{Number(n)+2}}</h2>
        <h1 :class="'hd'+n">表达式</h1>
        <input v-model="n"/><br/>
        <input type="radio" v-model="n" value="1"/>男
        <input type="radio" v-model="n" value="2"/>女
    </div>
<script src="../js/jquery-2.2.0.min.js"></script>
<script src="../js/vue-2.5.16.js"></script>

<script>
    var app = new Vue({
        el:'#app',
        data:{
            name:'模版数据',
            n:1
        }
    });
</script>

</body>
</html>